#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)
#include<stdio.h>
#include<stdlib.h>
typedef struct Stu
{
	struct Stu* next;
	int val;
}ListNode;

int main()
{
	int a = 0;
	ListNode* head = NULL;
	ListNode* cur = head;
	for (int i = 0; i < 5; i++)
	{
		ListNode* p = (ListNode*)malloc(sizeof(ListNode));
		if (p == NULL)
		{
			perror("malloc");
			return 1;
		}
		scanf("%d", &a);
		p->val = a;
		head = p;
		head = head->next;
	}
	head->next = NULL;
	for (int i = 0; i < 5; i++)
	{
		printf("%d->", cur->val);
		cur = cur->next;
	}
	printf("NULL");
	return 0;
}